package app.netant.book.sc29;

import java.net.URLEncoder;

import app.netant.book.base.BaseDown;
import app.netant.book.sjxs.SjxsDown;

public class Sc29Down extends BaseDown {

	@Override
	public void downFile(String filePath, String url) throws Exception {
		
		String urlName = url.substring(url.lastIndexOf("name=")+5);
		urlName = URLEncoder.encode(urlName, "utf-8");
		String urlPlus = url.substring(0,url.lastIndexOf("name=")+5);
		
		String newUrl = urlPlus + urlName;
		
		System.out.println("【NewUrl】:"+newUrl);
		
		this.downReferFile(filePath, newUrl);
		
	}
	
	public static void main(String[] args) throws Exception {
		System.out.println("开始测试下载");
		Sc29Down downControl = new Sc29Down();	
		downControl.setRefer("http://www.29sc.net/download/80431.html");
		downControl.downFile("D:/测试.txt", "http://www.29sc.net/down.php?bid=80431&name=魔幻娱乐 第051－063章");		
		System.out.println("结束测试下载");
	}

}
